package com.chen.wow.day02.javaconfig;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@ComponentScan
@Configuration//配置类，该类包含在Spring应用上下文中如何创建bean的细节
public class MyConfig {

	@Bean
	public CDone cdone(){
		CDone cdone =  new CDone();
		cdone.setName("cdone name");
		return cdone;
	}
	
	@Bean
	public CDPlayer cdPlayer(){
		return new CDPlayer(cdone());
	}
	
	@Bean
	public CDPlayer anotherCdPlayer(){
		return new CDPlayer(cdone());
	}
}
